<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../vue.js"></script>
  <style>
    .public{
      width: 100px;
      height: 100px;
    }
    .active{
      background-color: brown;
    }
    .noActive{
      background: #000;
    }
    .red{
      color: red
    }
    .bold{
      font-weight: bold;
    }
    .italic{
      font-style: italic;
    }
  </style>
</head>

<body>
  <div id="app">
    <div class="public" :class="isActive?'active':'noActive'">box1</div>
    <div class="public" :class="fontColor">box2</div>
    <div class="public" :class="boxObj">box3</div>
    <div class="public" :class="{red:isRed,bold:isBold,italic:isItalic}">box4</div>
    <div class="public" :class="boxArr">box5</div>
  </div>
  <script>
    Vue.config.productionTip = false;
    
    const vm = new Vue({
      el: "#app",
      data() {
        return {
          isActive:false,
          fontColor:'red',
          boxObj:{
            red:true,
            bold:true,
            italic:true
          },
          isRed:true,
          isBold:true,
          isItalic:false,
          boxArr:['red','italic']
        }
      }
    })
  </script>
</body>

</html>